import request from '@/config/axios'
import type { AppParameterName } from './types'

export const getAppParameterNamesListApi = (params: any): Promise<IResponse> => {
  return request.get({ url: '/app-parameter-names', params })
}

export const createAppParameterNamesApi = (data: Partial<AppParameterName>): Promise<IResponse> => {
  return request.post({ url: '/app-parameter-names', data })
}

export const updateAppParameterNamesApi = (
  id: string,
  data: Partial<AppParameterName>
): Promise<IResponse> => {
  return request.put({ url: `/app-parameter-names/id/${id}`, data })
}

export const getAppParameterNamesDetailApi = (id: string): Promise<IResponse<AppParameterName>> => {
  return request.get({ url: `/app-parameter-names/id/${id}` })
}

export const copyToHotelsApi = (): Promise<IResponse> => {
  return request.post({ url: `/app-parameter-names/copy-to-hotels` })
}
